package aiku.numericalcontroloa.Controller.ExamineController;

import aiku.numericalcontroloa.Base.Utils.Result;
import aiku.numericalcontroloa.Model.Dto.UserDto;
import aiku.numericalcontroloa.Model.Vo.ExamineVo;
import aiku.numericalcontroloa.Service.Impl.ExamineServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 马文杰
 * @version 1.0
 */
@RestController
@RequestMapping("/examine")
public class ExamineController {
    @Autowired
    private ExamineServiceImpl examineService;

    /**
     * 管理查询所有用户信息
     */
    @RequestMapping("/examineList")
    public Result examineList() {
        return examineService.examineList();
    }

    /**
     * 管理修改用户关系
     */
    @RequestMapping("/examineUpdate")
    public Result examineUpdate(@RequestBody ExamineVo examineVo) {
        return examineService.examineUpdate(examineVo);
    }

    /**
     * 通过用户角色类型查询所有相关用户信息
     */
    @RequestMapping("/examineByType")
    public Result examineByType(@RequestParam("type") String type) {
        return examineService.examineByType(type);
    }

    @RequestMapping("/getExamineList")
    public Result getExamineList(@RequestBody UserDto userDto){
        return examineService.getExamineList(userDto);
    }
}
